package demo.using.threadPool;

public class TestMain1{

    private static boolean runFlag = true;

    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(() -> {
            while (runFlag) {
                System.out.println(Thread.currentThread().getName()+"��run");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        // start ��ͨ��thread�߳�ִ���ڲ������
        thread.start();
        // run ��ͨ��main�߳�ִ���߳��ڲ������
//        thread.run();
        Thread.sleep(5000);
        runFlag = false;
        System.out.println("finish");
    }

}